My Math Forum  

Go Back   My Math Forum > Science Forums > Computer Science

Computer Science Computer Science Forum


Reply
 
LinkBack Thread Tools Display Modes
June 21st, 2017, 03:13 AM   #11
Member
 
Joined: May 2017
From: Russia

Posts: 33
Thanks: 4

<?php
\$d= hexdec("A8");

for (\$n=0; \$n < 6; \$n++) {
echo dechex(++\$d) . PHP_EOL;
}
?>

Last edited by skipjack; June 21st, 2017 at 03:16 AM.
ABVictor is offline  
 
July 11th, 2017, 12:57 PM   #12
pst
Newbie
 
Joined: Jul 2017
From: US

Posts: 7
Thanks: 0

Quote:
Originally Posted by pvesel View Post
Thank you for your answer. However this is pure math:

https://en.wikipedia.org/wiki/Hexadecimal and it is connected to the code above. However:
How can you get: A9 B0, B1

Math functions are the core of the php.

If anyone has any idea how to go through this, with any good books, samples will be rewarded. I went through w3 school all the task, read some books, but it is not enough for understand loops.
Hexadecimal is a number system just like our decimal base 10 system. To say it's "pure math" is like saying the decimal system is pure math. It's just a way to represent numbers.

A good book would be a book reference for Hexadecimal and PHP, not a math book.
pst is offline  
October 12th, 2017, 05:53 AM   #13
Math Team
 
Joined: Jan 2015
From: Alabama

Posts: 2,824
Thanks: 752

Is this question about PHP programming or just about the mathematics?

The mathematics is: "A8" in hexadecimal is the same as 10(16)+ 8= 168 in decimal. Incrementing that, 168+ 1= 169= 10(16)+ 9= "A9" in hexadecimal.

Incrementing again,169+ 1= 170= 10(16)+ 10= "AA" in hexadecimal.

Incrementing again, 170+ 1= 171= 10(16)+ 11= "AB" in hexadecimal.

Incrementing again, 171+ 1= 172= 10(16)+ 12= "AC" in hexadecimal.

Incrementing again, 172+ 1= 173= 10(16)+ 13= "AD" in hexadecimal.

We can keep on incrementing in exactly that way to 175= 10(16)+ 15= "AF" but after that 175+ 1= 176= 11(16)+ 0= "B0" in hexadecimal.

Last edited by skipjack; October 12th, 2017 at 09:21 AM.
Country Boy is offline  
Reply

  My Math Forum > Science Forums > Computer Science

Tags
hexadecimal, php, pls, stucked



Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
hexadecimal algorithm Techmaster Computer Science 7 August 26th, 2014 02:29 PM
Signed hexadecimal computation! eChung00 Computer Science 3 March 4th, 2013 03:59 PM
Binary to hexadecimal Igo Computer Science 3 September 7th, 2012 04:58 AM
Hexadecimal Addition... Primalscientist Computer Science 13 April 20th, 2011 01:41 PM
Hexadecimal Notation Primalscientist Computer Science 3 April 17th, 2011 04:31 AM





Copyright © 2017 My Math Forum. All rights reserved.