Bitcoin Forum
November 07, 2024, 04:34:41 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to limit the number of decimal numbers obtained during calculation and used?  (Read 179 times)
COBRAS (OP)
Member
**
Offline Offline

Activity: 1016
Merit: 23


View Profile
April 16, 2022, 06:52:02 PM
Last edit: April 16, 2022, 07:04:36 PM by COBRAS
 #1

How to limit the number of decimal numbers obtained during calculation and used in calculations ?

Good day.

Then I use keymath and modmath and devide for deviding for example 777 / 999 = 0.77777777777777777....7 inf. modmath and keymath genererate result not with minimum needed float numbers 0.77777777777777777(This will be named X) * 999 = 777.0, but with maximum nposible float number - 0.77777777777777777777777777777777777777777777777777777777777777777777777777777 7777777777777777777777777777777777777777777777777777777777777777 ........7 (this will be named Y) * 999 = 777.0 and private / publick keys for X and Y are different !!!

How to use in calculus editable floats count in result ?


0.77777777777777777 * 999 = 777


0.77777777777777777777777777777777777777777777777777777777777777777777777777777 7777777777777777777777777777777777777777777777777777777777777777 * 999 = 777


0.77777777777777777777777777777777777777777777777777777777777777777777777777777 7777777777777777777777777777777777777777777777777777777777777777 - THIS IS TOO MANY, HOW TO MODIFY MODMATH AND KEYMATH USE THIS - 0.77777777777777777
 RESULT OF THEIR CALCULATION

help plesse ?


[
n0nce
Hero Member
*****
Offline Offline

Activity: 882
Merit: 5918


not your keys, not your coins!


View Profile WWW
April 16, 2022, 07:53:35 PM
 #2

Actually 777/999 is just 7/9. There is no non-infinite decimal representation of it.

If you plug it into a calculator, due to rounding, it gives the same result if you multiply 0.7777*999 or 0.777777777777777*999, but to be exact, both shouldn't give you the exact number 777.

I don't know modmath / keymath, but depending on what you have to do and what tools it gives you, you might be able to just round to X decimal places. Or calculate with proper decimal fractions instead of decimal numbers.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
COBRAS (OP)
Member
**
Offline Offline

Activity: 1016
Merit: 23


View Profile
April 16, 2022, 08:31:08 PM
Last edit: April 16, 2022, 08:42:33 PM by COBRAS
 #3

Actually 777/999 is just 7/9. There is no non-infinite decimal representation of it.

If you plug it into a calculator, due to rounding, it gives the same result if you multiply 0.7777*999 or 0.777777777777777*999, but to be exact, both shouldn't give you the exact number 777.

I don't know modmath / keymath, but depending on what you have to do and what tools it gives you, you might be able to just round to X decimal places. Or calculate with proper decimal fractions instead of decimal numbers.

999 is a scalar, 777 is a publick key, how to get first 20 digits of 0.77777777....inf ? What is posible to do somethink with 0.77777777....inf pubkey, to get pubkey only from 20 first digits of 0.77777777....inf ?

Thx.

[
n0nce
Hero Member
*****
Offline Offline

Activity: 882
Merit: 5918


not your keys, not your coins!


View Profile WWW
April 17, 2022, 12:58:51 AM
 #4

Actually 777/999 is just 7/9. There is no non-infinite decimal representation of it.

If you plug it into a calculator, due to rounding, it gives the same result if you multiply 0.7777*999 or 0.777777777777777*999, but to be exact, both shouldn't give you the exact number 777.

I don't know modmath / keymath, but depending on what you have to do and what tools it gives you, you might be able to just round to X decimal places. Or calculate with proper decimal fractions instead of decimal numbers.

999 is a scalar, 777 is a publick key, how to get first 20 digits of 0.77777777....inf ? What is posible to do somethink with 0.77777777....inf pubkey, to get pubkey only from 20 first digits of 0.77777777....inf ?
Again, I don't know if your software / programming language / whatever allows to truncate or round to a certain amount of decimal places, but be aware that if you do, the result becomes mathematically wrong / inaccurate. You do need all the infinite decimal places to accurately describe a division of 9 (and other periodic numbers) if you don't want to use a proper decimal fraction (like '7 over 9').

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
COBRAS (OP)
Member
**
Offline Offline

Activity: 1016
Merit: 23


View Profile
April 17, 2022, 03:26:21 AM
 #5

Example: 0x35c0d7234df7deb0f20cf7062444) / 2**110) ) * 10000000000000000 = 8398950428744437 (does someone uderstand why  I need this and how to use it  Huh

This is not mod calculus.

(0.8398950428744437*2**110) - 0x35c0d7234df7deb0f20cf7062444 = 0

So, if someone show how to hack tjis shit, it can be good !

So, Lets power on our brains !!!

[
garlonicon
Copper Member
Legendary
*
Offline Offline

Activity: 921
Merit: 2208


Pawns are the soul of chess


View Profile
April 17, 2022, 04:10:34 AM
Merited by vapourminer (1), ABCbits (1)
 #6

You are getting implementation-dependent garbage numbers. It is hard to say how to get those numbers, because without code, we have no idea, where you made a mistake in your own code.

But I guess it is related to float precision. Maybe check basic things, for example that adding 0.1 ten times gives you exactly 1.

pooya87
Legendary
*
Offline Offline

Activity: 3626
Merit: 11010


Crypto Swap Exchange


View Profile
April 17, 2022, 04:21:55 AM
 #7

Why do you even have decimals? You mention scalar and publickey and this is a bitcoin board so you must be working with modular arithmetic where you should only deal with integers (numbers without decimals or fractions).

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
COBRAS (OP)
Member
**
Offline Offline

Activity: 1016
Merit: 23


View Profile
April 17, 2022, 05:10:26 AM
 #8

Why do you even have decimals? You mention scalar and publickey and this is a bitcoin board so you must be working with modular arithmetic where you should only deal with integers (numbers without decimals or fractions).

But, secp256  curve think anower, divide 68140381134624198284233778684484 this priv to 1298074214633706907132624082305024 you get float coded in hex !

You can convert decimail geted in not mod calc and get back privkey.

And publick key math operation and pablick key are same, is simple use then you have all pub's or priv's, privs or pabs and vs.You can multiply privs, and get pubs from result * base poit, or use pab and multiply to priv ang get pubkey what will be same.

[
COBRAS (OP)
Member
**
Offline Offline

Activity: 1016
Merit: 23


View Profile
April 17, 2022, 05:11:58 AM
 #9

You are getting implementation-dependent garbage numbers. It is hard to say how to get those numbers, because without code, we have no idea, where you made a mistake in your own code.

But I guess it is related to float precision. Maybe check basic things, for example that adding 0.1 ten times gives you exactly 1.

68140381134624198284233778684484 this is a priv puzzle 110 in dec, this is a 2^110 range - 1298074214633706907132624082305024.


[
ABCbits
Legendary
*
Offline Offline

Activity: 3052
Merit: 8064


Crypto Swap Exchange


View Profile
April 17, 2022, 11:18:49 AM
Last edit: April 17, 2022, 11:50:57 AM by ETFbitcoin
Merited by vapourminer (1), n0nce (1)
 #10

You are getting implementation-dependent garbage numbers. It is hard to say how to get those numbers, because without code, we have no idea, where you made a mistake in your own code.

But I guess it is related to float precision. Maybe check basic things, for example that adding 0.1 ten times gives you exactly 1.

There's even website about it at https://0.30000000000000004.com/.

I don't know modmath / keymath

OP might be referring to this repository, https://github.com/albertobsd/ecctools.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!