Shop OBEX P1 Docs P2 Docs Learn Events
Floating Point Math — Parallax Forums

Floating Point Math

sparksandtabssparksandtabs Posts: 3
edited 2022-12-08 17:57 in BASIC Stamp
..

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-12-26 11:33
    The BASIC Stamp is integer based, but does have two operators that may help: */ and **. In short, */ multiplies by fractional values expressed in units of 1/256, while ** multiplies by fractional values of 1/65536 -- but both return integer results.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-12-28 21:59
    You can also do true blue floating point using the Floating Point Coprocessor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • dechief micheldechief michel Posts: 75
    edited 2005-12-28 22:24
    Hy paul, again i thank you for your help before(measurement of mA with oscilloscope).
    About your intervention of today, please remember than microprocessor(and microcontroller) are based on binary calculation
    The only way to create a floating point whit thi kind of calculator is the use of flag, register and the ability of boolean calculation to invert a multiplication in to a division(and vice versa).
    At this day i've not yet experimented that whit a Stamp but if you remember before( at least 30 years ago) its wha the same in assembly language with the ZILOG Z80 for sample.
    To day, unfortunatelly, they are not so much people who's are using this kind of langage.
    By sample:
    To day you got 1
    Tomorrow 1 again

    TOTAL for everybody=2
    Wrong: Total = 3 because in boolean application you give a historical signification to the older one.
    Actually they said: most significant bit, lower significant bit.
    Enjoy than you can apply this rule whith a stamp??
    Let me know
    michel.dechief@skynet.be

    ps: sorry again for my bad aknowledgement in english(parlez vous fran
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-12-28 23:16
    The floating point coprocessor deals with IEEE floating point numbers which are 32 bit quantities subdivided into the mantissa and exponent each with an associated sign, all the details of performing a mathmatical operation are hidden from the user. It also provides conversion functions to allow easier manipulations of numbers on a non-floating point master processor.

    Ma seulement compr
  • dechief micheldechief michel Posts: 75
    edited 2005-12-28 23:53
    Nice your answer,
    Remember only than a microprocessor stay a microprocor.
    May be a 8 bit, 16 bit, 32 or why not 256 .
    Its possible for me to send you sample for diverse formulation of binary counting.
    To be kick and also because it's time for me to go to sleep(belgium time:00.28 at night) i would to explend you the transfer of bit from a byte to another.for this you have to know how s working your microprocessor.
    How many flags available, how many register are free, witch kind of memory(dinamic, as ram or eeprom you dispose).
    At first, select a number as decimal; by sample: 256
    secondly give a lok to the same number on to a 8 bit :11111111
    Ok i'm sure you know that.
    no, give a look to a decimal number like : 0
    Where is a floating point and what i s this number on to binary: 00000000
    Do the addition of the two first number in to binary calculation:
    11111111
    00000000
    11111111
    modify to d
Sign In or Register to comment.