Announcement

Collapse
No announcement yet.

Fuzzy Math

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mike Trader
    replied
    aaaaaaaaaaaaaaaah! Integer division and MODulo. I get it. thx so much guys

    ------------------
    Kind Regards
    Mike

    Leave a comment:


  • Michael Mattias
    replied
    Result = Date/100
    Remainder = Result - FIX(Result)
    OR:
    Code:
    Result = Date\ 100            ' integer divide "\"
    Remainder = Result MOD 100
    MCM

    Leave a comment:


  • Bern Ertl
    replied
    Try :

    Code:
    LOCAL Remainder AS DOUBLE
    LOCAL Result AS DOUBLE
    
    
    Result = Date/100
    Remainder = Result - FIX(Result)
    MSGBOX "FIX( "+STR$(Remainder* 100)+") = " + STR$( FIX(Remainder* 100) )

    ------------------
    Bernard Ertl

    [This message has been edited by Bern Ertl (edited March 05, 2001).]

    Leave a comment:


  • Mike Trader
    started a topic Fuzzy Math

    Fuzzy Math

    Im doing simple division (moving the decimal place) for my Date to Julian Function (thanks Lance) and I found a bug which I traced down to this (run example)

    Could someone tell what the heck is going on?

    #COMPILE EXE "Fuzzy.exe"

    GLOBAL Date AS LONG
    '¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤'
    FUNCTION PBMAIN

    Date = 991209

    ' Year& = 1900 + Date/10000
    ' Month& = FIX((Date/10000 - FIX(Date/10000))*100)
    ' Day& = FIX((Date/100 - FIX(Date/100)) *100)

    MSGBOX( "( "+STR$(Date/100)+" - "+STR$(FIX(Date/100))+" ) * 100 = "+STR$(FIX((Date/100 - FIX(Date/100))*100))+" !!!" )

    END FUNCTION
    '¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤'

    ------------------
    Kind Regards
    Mike
Working...
X
😀
🥰
🤢
😎
😡
👍
👎