Shop OBEX P1 Docs P2 Docs Learn Events
F32 Error Report — Parallax Forums

F32 Error Report

John AbshierJohn Abshier Posts: 1,116
edited 2011-05-02 07:52 in Propeller 1
I found an error in FRound. My version of F32 has last change on Nov 27, 2010
con

  _clkmode = xtal1 + pll16x
  _xinfreq = 5_000_000                                          ' use 5MHz crystal
' _xinfreq = 6_250_000                                          ' use 6.25MHz crystal

  CLK_FREQ = ((_clkmode - xtal1) >> 6) * _xinfreq
  MS_001   = CLK_FREQ / 1_000
  US_001   = CLK_FREQ / 1_000_000

  #1, HOME, #8, BKSP, TAB, LF, CLREOL, CLRDN, CR, #16, CLS      ' PST formmatting control


obj
  F : "F32"
  Sio  : "FullDuplexSerialPlus"        
  
PUB Main   | x
  F.Start
  Sio.start(31,30,0,115200)  ' Rx,Tx, Mode, Baud
  waitcnt(clkfreq * 3 + cnt)
  x := 1.1
  Sio.dec(F.FRound(x))
  Sio.tx(CR)
  x := 5.5
  Sio.dec(F.FRound(x))
  Sio.tx(CR)
  x := 10.6
  Sio.dec(F.FRound(x))
  Sio.tx(CR)
  x := 0.0
  Sio.dec(F.FRound(x))
  Sio.tx(CR)
  x := -0.9
  Sio.dec(F.FRound(x))
  Sio.tx(CR)
  x := -5.5
  Sio.dec(F.FRound(x))
  Sio.tx(CR)
  x := -10.4
  Sio.dec(F.FRound(x))
  Sio.tx(CR)
{ Resuts
1
6
11
0
0    should be -1 for x := -0.9
-6
-10
}  


John Abshier

Comments

  • lonesocklonesock Posts: 917
    edited 2011-04-28 13:01
    OK, I will look into this tonight, thanks!

    Jonathan
  • lonesocklonesock Posts: 917
    edited 2011-04-28 13:38
    Found the problem: the max command sets C if D<S...I was expecting it to set C if D<=S. The fix only cost one extra PASM instruction, so I'm happy about that.

    Thanks so much for catching and reporting this! Please give this version a try...if no other problems arrive, I'll upload this version 1.3 to the OBEX.

    thanks,
    Jonathan
  • John AbshierJohn Abshier Posts: 1,116
    edited 2011-04-28 15:26
    That fixed it. Now to get this version of F32 into all machines. I wish there was a way to "check to see if library files are up to date."

    John Abshier
  • lonesocklonesock Posts: 917
    edited 2011-05-02 07:52
    Thanks, John. Version 1.3 is now in the OBEX. Yep, it would be great to have a "check-for-object-updates" option in the IDE...since the OBEX has a version field I would think it would be reasonably simple to add.

    Jonathan
Sign In or Register to comment.