News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Hyper (precision) numeric data type

Started by i Z !, October 15, 2023, 07:38:52 PM

Previous topic - Next topic

i Z !

I admit, this one was kinda shitty and it wasn't fully functional.
But now this one is the real thing. Nearly...

Hit me up @ https://github.com/SilverfoxSystems/Hyper
& http://silverfox.systems/Hyper/

HSE

Equations in Assembly: SmplMath

i Z !

It's a mixture of a String and a floating-point number. It consists of Int64 array and an Int32 which describes the lowest exponent.

EDIT:
"Adaptive float" would maybe describe it best

HSE

What are range and precision of that format?
Equations in Assembly: SmplMath

i Z !

As far as the mentioned Int64 array's size goes, this is how big the mantissa can be.

I.E.
if initialized as
New Hyper(5000,-5000) (low and high "exponents")
then it'd have buffer(mantissa) of length of 10000 * 8 bytes.

The Int32 mentioned describes number of starting QWORD or as I call it, Exponent64 or exp64 in my descriptions.
In fact, the number used is called precision which is the negated LOWEST exp64 .

So the precision is enormous - as many bits there are in approx. 8 * 2GB with the mentioned Int32 offset.
You can have an entire RAM describing a single number :)

HSE

Ok. It's an "arbitrary precision" format.

Precision depends on mantissa, not exponent. Range depends on exponent.

 :thumbsup:
Equations in Assembly: SmplMath

i Z !

i agree  :smiley:  never heard of that format, thanx 4 clearing it out

only thing that maybe differs from others is that it works on balanced numeral system (with base 2^64) - some advantages: sign bit isn't needed, every 64th bit is negative => no rounding error + no need of filling bits when expanding mantissa's size

jack

@ i Z !
the one thing that bothers me is the restrictive license

i Z !

Quote from: jack on October 16, 2023, 09:45:57 PM@ i Z !
the one thing that bothers me is the restrictive license

it lets you do whatever with it. only not making money off my hard work :)

or you had something specific in mind?

jack

Quote from: i Z ! on October 16, 2023, 11:07:30 PMor you had something specific in mind?
not really, I also have dabbled in writing my own multi precision arithmetic routines, just for fun.
what number base do you use for your routines? 

jack

i Z !
this the kind of license that would acceptable to me, it's from https://bellard.org/libbf/
Quote/*
 * Tiny arbitrary precision floating point library
 *
 * Copyright (c) 2017-2020 Fabrice Bellard
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

i Z !


i Z !

Quote from: jack on October 17, 2023, 12:30:47 AM
Quote* Permission is hereby granted, free of charge, to any person obtaining a copy...
...
...
...

Sorry but I get lost before finishing reading it  :smiley:

EDIT this is a MIT licence (according to website), which allows commercial use, so i'm not alright with that

jack

suit yourself, MIT is one the most simplest licenses, if you can't understand that then I doubt your ability to code a decent MP library

i Z !

Quote from: jack on October 17, 2023, 02:19:44 AMsuit yourself, MIT is one the most simplest licenses, if you can't understand that then I doubt your ability to code a decent MP library

hah, give it a go mr lawyer

it's as 'decent' as it gets :)