English
Source / code snippets

On 15 to put detailed Integer-function for Floatingpoint-variables

 

p.specht

How the Result of print int(1e14):waitinput shows, is the INT()-function only for 4-byte-Integers virtual. who but think, one simple round(a!-0.5, 0) would wealthy, the has its bill without The Untiefen the maths-Paketes of Delphi made. the shows itself too in XProfan.

to that example is it none slight, the system The spending of "Minus-Null" (-0.000000) abzugewöhnen and negatives How postive numbers same To treat. as long as the Zahlenwert 15 to put not überschreitet, dürften The gröbsten Bugs now but eliminating his. selected understanding, The thing remaining nevertheless without each warranty ...
Window Title "Integer-function for Floats To 15 Stellen"
Cls:declare a!,sgn!:set("decimals",18)
repeat:print "\n Float-worth: ";:input a!:print Intf(a!)

until 0

proc Intf :parameters a!

var sgn!=if(abs(a!)<val("1e-16"),0,if(a!<0,-1,1))
return val(stature$("%g",sgn!*abs(round(abs(a!)-0.5,0))))

endproc

 
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/25/21  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.506 Views

Untitledvor 0 min.
Erhard Wirth06/14/24
H.Brill08/04/23
p.specht11/21/21
R.Schneider11/20/21
More...

Themeninformationen

this Topic has 1 subscriber:

p.specht (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie