ForthHub / discussion

Discussion repository for Forth enthusiasts.
116 stars 4 forks source link

Are there any Posit implementations out there? #86

Closed CCurl closed 1 year ago

CCurl commented 4 years ago

From what I have read, Posits has many advantages over Floats.

Does anyone know about any Forth implementations of it?

phreda4 commented 4 years ago

I don't know about posit but I am almost sure that integers are better than floating point

I only found one case where I couldn't replace them but I think I couldn't find the proper algorithm for this, this is the correct perspective textured triangle drawing.

The easy way to translate the programs is using the fixed point

The approximation of numbers to extend the range of representation does not seem to me a good idea, especially since there will always be a loss of precision, it is preferable to manage these limits of representation

CCurl commented 4 years ago

I am not suggesting to replace the integer operations with Posit, but for those cases where you need non-integer numbers, Posit numbers are better in many ways over floating point numbers.

phreda4 commented 4 years ago

Sorry, I don't think I explain myself well. I think it is not necessary to use the floating point numbers in any case.

MitchBradley commented 4 years ago

There are posit libraries like this one: https://gitlab.com/cerlane/SoftPosit . It would be possible to use, say CForth and replace the floating point operations in floatops.c with calls to the corresponding Posit operations.

paraplegic commented 4 years ago

If you haven't seen Gustafson's talk on Posits, then it is well worth the hour or so ... on YouTube. I look forwared to hardware manufacturers moving from IEEE-754 to Posits, or at least implementing both in hardware.

On Fri, 3 Apr 2020, Mitch Bradley wrote:

Date: Fri, 03 Apr 2020 11:31:50 -0700 From: Mitch Bradley notifications@github.com Reply-To: ForthHub/discussion reply@reply.github.com To: ForthHub/discussion discussion@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [ForthHub/discussion] Are there any Posit implementations out there? (#86)

There are posit libraries like this one: https://gitlab.com/cerlane/SoftPosit . It would be possible to use, say CForth and replace the floating point operations in floatops.c with calls to the corresponding Posit operations.

? You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.[AAS2KERZ674RFU6C3CQNRVDRKYTRNA5CNFSM4L4BJPM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOERDGWRI.gif]

-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Robert S. Sciuk rob@controlq.com Principal Consultant 905.706.1354 Control-Q Research 97 Village Rd. Wellesley, ON N0B 2T0

CCurl commented 4 years ago

Thanks folks!