English
Forum

rounds, as I do not gefällt ...

 

Erasmus.Herold
Hallöchen.

I have the following Rundungsproblem.
has someone a idea?
temp! = 64.975
print "DEMO 1: ", temp!
temp! = ROUND(temp!,2)
print "DEMO 2: ", temp!

Output the screen:
DEMO 1: 64.975000
DEMO 2: 64.970000

I expect but:
DEMO 2: 64.980000

thanks for eure ideas.
 
11/13/18  
 




p.specht

the called Inkomensurabilität: The number 64.975 is binary only slightly To small representable. remedy would here only, with 1+1e-15 To multiplizieren, so The latest the 16 signifikanten to put a "Schubs" sustain. then is ever another number on this unfavourable place on the Zahlengeraden...

one sees what there very happens, if one itself any 17 Nachkommastellen Show can.
greeting
Cls
Print round(64.975*1.000000000000001,2)
print
set("decimals",17)
print 64.975
print 64.975 * 1.000000000000001
waitinput
 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
11/13/18  
 




Erasmus.Herold
gavel!

thanks - so try I my Happiness.
 
11/14/18  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.503 Views

Untitledvor 0 min.
Michael Hettner09/02/21
Normann Strübli03/31/20
Stefan8112/30/19
Pk12/01/19
More...

Themeninformationen

this Topic has 2 subscriber:

Erasmus.Herold (2x)
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