Forum > Beginners

floating point literals

<< < (7/7)

PascalDragon:

--- Quote from: TRon on February 24, 2024, 04:56:20 pm ---So the question as of which directives are supported by push/pop seem to be a legitimate one. The basic rule is, as I always assumed, for every local directive as documented:

--- Quote ---The $PUSH directive saves the current values of all local compiler directives on the settings stack

--- End quote ---

--- End quote ---

The development version of the documentation is already improved in that regard (especially note the difference between “directives” and “switches” in the first sentence).

TRon:

--- Quote from: PascalDragon on February 25, 2024, 04:55:13 pm ---The development version of the documentation is already improved in that regard (especially note the difference between “directives” and “switches” in the first sentence).

--- End quote ---
Thank you for that link/hint PascalDragon. tbh I did not check the daily docs regarding this subject  :-X

Paolo:
@fcu thanks to check

@nanobit, thanks for the info, my setting are the nominal one ($excessprecision off), what about this code ? (see the exponent index, all can be rounded in single precision, am I wrong ?)


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---var  x, y : double;...  x:=0.1;  y:=y:=1.0E+0009/1.0E+0010;  if x=y then beep  //<-- never beep   x:=0.1;  y:=1.0E+0010/1.0E+0011;  if x=y then beep  //<--- beep 
thank you

nanobit:
1.0E+0010 (single) and 1.0E+0011 (double, required min type),
so the operation is done in higher precision.

Paolo:
but the question is exactly this:

why 1.0E+0010 it is assumed as single and 1.0E+0011 double ? 1.0E+0011 still fits in single.
missed something ?

[EDIT] OK I see that 1e+11 is not "correctly" represented in single.

Navigation

[0] Message Index

[*] Previous page

Go to full version