Raised This Month: $32 Target: $400
 8% 

[INC] Number Conversions


Post New Thread Reply   
 
Thread Tools Display Modes
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 09-21-2010 , 18:59   Re: [INC] Number Conversions
Reply With Quote #11

Quote:
Originally Posted by fysiks View Post
I believe it means decimal 3 would show as binary 11 and decimal 5 would show as binary 101.
Fixed
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-21-2010 , 19:12   Re: [INC] Number Conversions
Reply With Quote #12

Quote:
Originally Posted by YamiKaitou View Post
Fixed
Yes, but it's actually in decimal. It's the digits that are being displayed. So 5 shown as "binary" would be one hundred and one (which is a decimal number)

I'm sure the four of us understand. Just want to make it clear to those who don't.
__________________
fysiks is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 09-22-2010 , 05:12   Re: [INC] Number Conversions
Reply With Quote #13

Good job !

and I have problem, maybe it's a request !

In China we need to save the file with UTF-8 without bom .
so , if I want to use log function, then the char of the cn part can be read !
I poor on C++, and I have no idea in pawn !
hope you can do it !
sorry for my bad en !
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 09-22-2010 , 06:44   Re: [INC] Number Conversions
Reply With Quote #14

Quote:
Originally Posted by Exolent[jNr] View Post
It's mainly for display purposes since it wouldn't necessarily be helpful in code.
Quote:
Originally Posted by fysiks View Post
I believe it means decimal 3 would show as decimal 11 and decimal 5 would show as decimal 101. I wondered this before also but took me a while to figure it out lol. Seems only good for arguments of printf() like functions (as Exolent said).
I'm not stupid
My point was anything above 1023 will result in an overflow, it should write to a string as the other stocks.
Seta00 is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 09-22-2010 , 06:47   Re: [INC] Number Conversions
Reply With Quote #15

Quote:
Originally Posted by Seta00 View Post
I'm not stupid
My point was anything above 1023 will result in an overflow, it should write to a string as the other stocks.
Yup. Also a format function would be a good idea.
Ex:
extraformat("Number: %d %x %b", 5, 11, 5)
Output: Number 5 0xB 0000...0101
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.

Last edited by ot_207; 09-22-2010 at 06:50.
ot_207 is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 09-22-2010 , 08:51   Re: [INC] Number Conversions
Reply With Quote #16

Quote:
Originally Posted by ot_207 View Post
Yup. Also a format function would be a good idea.
Ex:
extraformat("Number: %d %x %b", 5, 11, 5)
Output: Number 5 0xB 0000...0101
good idea, should be in the amxx core
better to be powerful as c++/cli's String::Format
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-22-2010 , 12:27   Re: [INC] Number Conversions
Reply With Quote #17

Quote:
Originally Posted by Seta00 View Post
I'm not stupid
My point was anything above 1023 will result in an overflow, it should write to a string as the other stocks.
I knew it was going to have a limit, but I didn't take the time to see what it was.
I suppose there's no reason for having one function with a limit and another without.
I replaced the original <Number>ToBinary and BinaryTo<Number> with the string versions.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 09-22-2010 , 18:57   Re: [INC] Number Conversions
Reply With Quote #18

Quote:
Originally Posted by Exolent[jNr] View Post
I knew it was going to have a limit, but I didn't take the time to see what it was.
I suppose there's no reason for having one function with a limit and another without.
I replaced the original <Number>ToBinary and BinaryTo<Number> with the string versions.
cell = 32bits, limit = 2^32-1
Nice addition
Seta00 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-22-2010 , 19:06   Re: [INC] Number Conversions
Reply With Quote #19

Quote:
Originally Posted by Seta00 View Post
cell = 32bits, limit = 2^32-1
Nice addition
I know the 32bit limit for integers, but I was talking about the 1023 limit.
I knew the binary integer result would be the decimal result of converting 1111111111 but I didn't take the time to look at it.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 10-04-2010 , 08:03   Re: [INC] Number Conversions
Reply With Quote #20

Quote:
Originally Posted by Exolent[jNr] View Post
I know the 32bit limit for integers, but I was talking about the 1023 limit.
Necroposting because of distraction (didn't see your reply):

The unsigned integer limit is 4 294 967 295, 10 characters long. 1023 = 2^10-1, 10 characters long as well. Everything above 1023 is eleven characters long or more, which means integer overflow.
Seta00 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode