Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Bug in plugin ROUND function

 [1/7] from: joseantoniorocha::gmail::com at: 12-Jan-2007 17:13


There is a bug in puglin ROUND function: The ROUND in plugin: round: func [ [catch] n [number! money! time!] /even /down /half-down /floor /ceiling /half-ceiling /to scale [number! money! time!] /local m ][ throw-on-error [ scale: abs any [scale 1] any [number? n scale: make n scale] make scale either any [even half-ceiling] [ m: 0,.0 * scale + n any [ all [ m = m: m - mod m scale even positive? m - n m - mod m scale + scale ] m ] ] [ any [ floor ceiling (ceiling: (found? half-down) xor negative? n down) n: add n scale * pick [0,.0 0,.0] ceiling ] either ceiling [n + mod negate n scale] [n - mod n scale] ] ] ] ROUND in VIEW: round: func [ {Returns the nearest integer. Halves round up (away from zero) by default.} [catch] n [number! money! time!] "The value to round" /even "Halves round toward even results" /down {Round toward zero, ignoring discarded digits. (truncate)} /half-down "Halves round toward zero" /floor "Round in negative direction" /ceiling "Round in positive direction" /half-ceiling "Halves round in positive direction" /to "Return the nearest multiple of the scale parameter" scale [number! money! time!] "Must be a non-zero value" /local m ][ throw-on-error [ scale: abs any [scale 1] any [number? n scale: make n scale] make scale either any [even half-ceiling] [ m: 0.5 * scale + n any [ all [ m = m: m - mod m scale even positive? m - n m - mod m scale + scale ] m ] ] [ any [ floor ceiling (ceiling: (found? half-down) xor negative? n down) n: add n scale * pick [-0.5 0.5] ceiling ] either ceiling [n + mod negate n scale] [n - mod n scale] ] ] ] -- nome: "José Antonio Meira da Rocha" tratamento: "Prof. MS." atividade: "Ensino e pesquisa em mídias digitais" googletalk: email: MSN: joseantoniorocha-gmail.com site: http://meiradarocha.jor.br ICQ: 658222 Skype: "meiradarocha_jor"

 [2/7] from: greggirwin:mindspring at: 12-Jan-2007 12:35


Hi José, JA> There is a bug in puglin ROUND function: JA> m: 0,.0 * scale + n ... JA> n: add n scale * pick [0,.0 0,.0] ceiling Wow. Looks like somebody did a search and replace and messed it up. Nice catch. -- Gregg

 [3/7] from: joseantoniorocha:g:mail at: 12-Jan-2007 17:44


The thing is worst: even a rewrited ROUND function suffers this find-and-replace illness. On 1/12/07, Gregg Irwin <greggirwin-mindspring.com> wrote:
> Hi José, > JA> There is a bug in puglin ROUND function:
<<quoted lines omitted: 7>>
> To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject.
-- nome: "José Antonio Meira da Rocha" tratamento: "Prof. MS." atividade: "Ensino e pesquisa em mídias digitais" googletalk: email: MSN: joseantoniorocha-gmail.com site: http://meiradarocha.jor.br ICQ: 658222 Skype: "meiradarocha_jor"

 [4/7] from: gabriele::colellachiara::com at: 13-Jan-2007 10:21


Hi Jos=E9, On Friday, January 12, 2007, 8:44:42 PM, you wrote: JA> The thing is worst: even a rewrited ROUND function suffers this JA> "find-and-replace" illness. Could it be just a bug with MOLD? Regards, Gabriele. -- Gabriele Santilli <gabriele-rebol.com> --- http://www.rebol.com/ Colella Chiara software division --- http://www.colellachiara.com/

 [5/7] from: joseantoniorocha:gm:ail at: 13-Jan-2007 15:09


I discover the bug in decimal point values conversions in portuguese Windows XP version. The problem occurs in any decimal value. If Windows language is turned to US English, the problem does not occurs. On 1/13/07, Gabriele Santilli <gabriele-colellachiara.com> wrote:
> Hi Jos=E9, > On Friday, January 12, 2007, 8:44:42 PM, you wrote:
<<quoted lines omitted: 9>>
> To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject.
-- nome: "Jos=E9 Antonio Meira da Rocha" tratamento: "Prof. MS." atividade: "Ensino e pesquisa em m=EDdias digitais" googletalk: email: MSN: joseantoniorocha-gmail.com site: http://meiradarocha.jor.br ICQ: 658222 Skype: "meiradarocha_jor"

 [6/7] from: joseantoniorocha::gmail::com at: 13-Jan-2007 15:11


I guess if it occurs in european versions Windows. Seems a decimal signal (comma) related problem. On 1/13/07, Jos=E9 Antonio <joseantoniorocha-gmail.com> wrote:
> I discover the bug in decimal point values conversions in portuguese > Windows XP version. The problem occurs in any decimal value. If
<<quoted lines omitted: 26>>
> googletalk: email: MSN: joseantoniorocha-gmail.com > site: http://meiradarocha.jor.br ICQ: 658222 Skype: "meiradarocha_jor"
-- nome: "Jos=E9 Antonio Meira da Rocha" tratamento: "Prof. MS." atividade: "Ensino e pesquisa em m=EDdias digitais" googletalk: email: MSN: joseantoniorocha-gmail.com site: http://meiradarocha.jor.br ICQ: 658222 Skype: "meiradarocha_jor"

 [7/7] from: rebolek::gmail::com at: 16-Jan-2007 9:43


Hi Jose, yes, there is some problem with decimal point / comma conversion in plugin On 1/13/07, José Antonio <joseantoniorocha-gmail.com> wrote:
> I guess if it occurs in european versions Windows. Seems a decimal > signal (comma) related problem.
<<quoted lines omitted: 42>>
> To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject.
-- / Boleslav Brezovsky http://krutek.info \

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted