Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 135,932 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 2,690 people online right now. Registration is fast and FREE... Join Now!




Large numbers in php

 
Reply to this topicStart new topic

Large numbers in php

Jon1001
18 May, 2008 - 09:20 AM
Post #1

New D.I.C Head
*

Joined: 31 Jan, 2008
Posts: 13


My Contributions
Hi. Have been learning php for a while now and recently tried to do some of the euler projects to get some practice but I've found that many of them use very large numbers e.g. 2^1000. When these are calculated, they are stored in standard form. For example, the previous example would be 1.0715086071863E+301. This is pretty useless so is there any way of stopping this from happening. Thanks.
User is offlineProfile CardPM
+Quote Post

JBrace1990
RE: Large Numbers In Php
19 May, 2008 - 12:16 PM
Post #2

D.I.C Regular
Group Icon

Joined: 9 Mar, 2008
Posts: 476



Thanked: 22 times
Dream Kudos: 350
My Contributions
number_format() is one way to do it, and the one I use most often...


This post has been edited by JBrace1990: 19 May, 2008 - 12:17 PM
User is offlineProfile CardPM
+Quote Post

Jon1001
RE: Large Numbers In Php
21 May, 2008 - 06:52 AM
Post #3

New D.I.C Head
*

Joined: 31 Jan, 2008
Posts: 13


My Contributions
That's done it. Thanks very much.
User is offlineProfile CardPM
+Quote Post

JBrace1990
RE: Large Numbers In Php
21 May, 2008 - 11:22 AM
Post #4

D.I.C Regular
Group Icon

Joined: 9 Mar, 2008
Posts: 476



Thanked: 22 times
Dream Kudos: 350
My Contributions
no problem =)
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 08:26AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month