Arrondi d'un réel

Vous lisez 4 fils de discussion
  • Auteur
    Messages
    • #1763
      Colonna
      Participant
      Up
      0
      Down
      ::

      Bonjour,

      existe-t-il un moyen pour n’afficher qu’un certain nombre de chiffres significatifs (à définir par le l’enseignant) sur un réel issu d’un calcul ?
      Exemple : dans un exercice de cinétique chimique, je cherche à afficher des concentrations dont les valeurs sont issues d’un calcul. Ces valeurs sont affichées avec 10 chiffres significatifs… J’aimerais me limiter à 3.
      Merci d’avance !!

    • #1764
      jm.evers
      Participant
      Up
      0
      Down
      ::

      There are several options,
      I choose ‘scienceprint’
      \text{A=wims(exec scienceprint 1234.56789999,3,0)}
      \text{B=wims(exec scienceprint 1234.56789999,3,1)}
      \text{C=wims(exec scienceprint 1234.56789999,3,2)}
      \text{D=wims(exec scienceprint 1234.56789999,3,3)}
      \text{E=wims(exec scienceprint 1234.56789999,3,4)}
      A=1.23*10^3
      B=1.23×10<sup>3</sup>
      C=1.23 \times 10^{3}
      D=1.23 k
      E=<math xmlns= »http://www.w3.org/1998/Math/MathML » display= »inline »><mstyle id= »wims_mathml » mathsize= »110% »><mn>1.23</mn><mo>×</mo><msup><mn>10</mn><mn>3</mn></msup></mstyle></math>

      kind regards,
      joke

      ######from scienceprinc.c #########
      WIMS usage:
      sci_num = !exec scienceprint number,significance,type
      number: a number
      significance : desired precision
      type (optional args): calc = 0 / html = 1 / latex = 2 / prefix = 3 / mathml = 4

      default : calc notation : 120000,3 -> 1.20*10^5
      type = 0 : calc notation : 120000,3,0 -> 1.20*10^5
      type = 1 : html notation : 120000,3,1 -> 1.20×10<sup>5</sup>
      type = 2 : latex notation : 120000,3,2 -> 1.20 \times 10^{5}
      type = 3 : prefix-notation : 120000,3,3 -> 120.0 k
      type = 3 : if -24 > prefix > 24 -> type = 1 (html)
      type = 4 : mathml notation

      multiple conversion: use space between arguments
      scienceprint 120000,4 122900,5 120036,6,3 –> 120.0*10^3,122.90*10^3,120.036 k

      24 yotta Y
      21 zetta Z
      18 exa E
      15 peta P
      12 tera T
      9 giga G
      6 mega M
      3 kilo k

      2 hecto h
      1 deca da
      -1 deci d
      -2 centi c

      -3 milli m
      -6 micro µ
      -9 nano n
      -12 pico p
      -15 femto f
      -18 atto a
      -21 zepto z
      -24 yocto y

    • #1765
      jm.evers
      Participant
      Up
      0
      Down
      ::

      and there is even a ‘verbatim’ prefix output…
      \text{F=wims(exec scienceprint 1234.56789999,3,5)}
      F=1.23 kilo

    • #1766
      Colonna
      Participant
      Up
      0
      Down
      ::

      Thanks a lot ! I’ll try as soon as I can…

      Best regards,

      Claire

    • #2787
      Yves NOEL
      Participant
      Up
      0
      Down
      ::

      ou encore avec moneyprint pour garder le(s) 0 en dernière(s) décimale(s). Il faut spécifier le nombre de décimales et non le nombre de chiffres significatifs.

      \text{F=wims(exec moneyprint 1.23045678 3)}

      F=1.230

      Yves

Vous lisez 4 fils de discussion
  • Vous devez être connecté pour répondre à ce sujet.