9!:10 and 9!:11

From J Wiki
< Vocabulary‎ | Foreigns‎ | 9
Jump to navigation Jump to search

Global Parameters/Print Precision

J typically uses the IEEE-754 double-precision binary floating point format which has extensive hardware support in current commodity CPUs. This format has 53 bits of mantissa, which mean it can represent 15 digit numbers. However various issues can lead to considerably less accuracy.

By default, J displays the first 6 digits of these numbers. This has been a reasonable compromise and also reflects something about how comfortably people retain numeric information in many contexts.

   9!:10''
6

This can be changed using 9!:11.

If we choose to display more digits than can be represented, J's display of the numeric values can illustrate inaccuracies resulting from the underlying machine representation.

   9!:11(20)

   0.1
0.10000000000000000555

Note also that ":!.n can be used to temporarily override this configuration parameter.

   ":,._5 0.123 0.5,5e99
                      _5
  0.12299999999999999822
                     0.5
5.0000000000000000795e99