Previous Up Next

5.1.3  La conversion d’un objet-unité dans une autre unité : convert convertir =>

convert permet d’obtenir la conversion d’un objet-unité dans une autre unité qui est le deuxième paramètre.
=> est la version infixée de convert ou convertir.
On tape :

convert(2_h+30_mn,_mn)

ou bien

2_h+30_mn=>_mn

On obtient :

150_mn

On tape :

convert(1_m*100_cm,_m^2)

ou bien

convert(100_(cm*m),_m^2)

ou bien

100_(cm*m)=>_m^2

On obtient :

1_m^2

On tape :

convert(1_h,_s)

Ou on tape :

1_h=>_s

On obtient :

3600_s

On tape :

convert(60_mn,_h)

Ou on tape :

60_mn=>_h

On obtient :

1.0_h

Remarque
Il faut mettre un espace avant l’unité si le nombre d’unité se trouve dans une variable ou si c’est une constante :
On tape :

convert(pi _rad,_deg)

Ou on tape :

pi _rad=>_deg

On obtient :

180.0_deg

On tape :

a:=180
convert(a _deg,_rad)

Ou on tape :

a _deg=>_rad

On obtient :

3.14159265358_rad

Previous Up Next