17.07.2013 Views

GWBASIC User's Manual

GWBASIC User's Manual

GWBASIC User's Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

GW-BASIC <strong>User's</strong> Guide<br />

FIX Function<br />

Purpose:<br />

To truncate x to a whole number.<br />

Syntax:<br />

FIX(x)<br />

Comments:<br />

FIX does not round off numbers, it simply eliminates the decimal point and all characters to the<br />

right of the decimal point.<br />

FIX(x) is equivalent to SGN(x)*INT(ABS(x)). The major difference between FIX and INT is<br />

that FIX does not return the next lower number for negative x.<br />

FIX is useful in modulus arithmetic.<br />

Examples:<br />

PRINT FIX(58.75)<br />

58<br />

PRINT FIX(-58.75)<br />

-58<br />

file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/FIX.html28/03/2004 21.29.01

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!