It is currently Thu Mar 23, 2017 5:06 pm



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: ROUND p.57 v1.90.01
Unread postPosted: Mon Mar 13, 2017 11:45 am 
Offline

Joined: Sat Feb 11, 2017 1:40 am
Posts: 52
Quote:
The <mode_sexp> is an optional rounding mode. It is a one-or two-character mnemonic code that tells ROUND() what kind of rounding to do.

1. What is the default? It is explained later, too later as for me. You should say here something like "see below".


Quote:
There are seven rounding modes:

"HE" Half-even -4.0 -4.0 -3.0 3.0 4.0 4.0
"HU" Half-up -4.0 -4.0 -3.0 3.0 4.0 4.0


2. Two ones actually do exactly the same, if I believe the table. Does not HE act differently of HU in some case?


Top
 Profile  
 
 Post subject: Re: ROUND p.57 v1.90.01
Unread postPosted: Tue Mar 21, 2017 4:30 am 
Offline

Joined: Wed Oct 03, 2012 9:53 am
Posts: 2775
Location: Colorado, U.S.
  1. There is no default rounding mode. The default behavior is different from all of the rounding modes. Perhaps I can make that clearer by putting "no mode" or "legacy mode" as a line in the table. My problem is that the modes are defined by Java, and the legacy mode is not defined by Java. The BASIC! programmer should not know or care what comes from Java.
  2. The table does not cover all possible cases. There isn't enough room. But there are enough cases that you know what would happen in all other cases.
    For example:
    • You can see that HE rounds -3.5 to -4, not -3. You can understand that it does that because -4 is even, and -3 is odd. Therefore HE would round -2.5 to -2.
    • However, HU rounds -3.5 to -4 because -4 is "up" (farther from 0) and -3 is "down" (closer to 0). By that understanding, you know that HU would round -2.5 to -3.
    While I am adding a row to the table, maybe I can see about squeezing in a column or two.

- Marc


Top
 Profile  
 
 Post subject: Re: ROUND p.57 v1.90.01
Unread postPosted: Tue Mar 21, 2017 5:05 am 
Offline

Joined: Sat Feb 11, 2017 1:40 am
Posts: 52
What do you think, Marc, of writing the following text?
The <mode_sexp> is an optional rounding mode. It is a one-or two-character mnemonic code that tells ROUND() what kind of rounding to do.
There is no default rounding mode, the default behavior (see it below) is different from all of the rounding modes. 


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
suspicion-preferred