Computers & Internet Logo

Related Topics:

A
Anonymous Posted on Nov 24, 2013

Binary octal 13015 in binary

1 Answer

kakima

Level 3:

An expert who has achieved level 3 by getting 1000 points

One Above All:

The expert with highest point at the last day of the past 12 weeks.

Top Expert:

An expert who has finished #1 on the weekly Top 10 Fixya Experts Leaderboard.

Superstar:

An expert that got 20 achievements.

  • Computers & ... Master 102,366 Answers
  • Posted on May 29, 2014
kakima
Computers & ... Master
Level 3:

An expert who has achieved level 3 by getting 1000 points

One Above All:

The expert with highest point at the last day of the past 12 weeks.

Top Expert:

An expert who has finished #1 on the weekly Top 10 Fixya Experts Leaderboard.

Superstar:

An expert that got 20 achievements.

Joined: Dec 16, 2009
Answers
102366
Questions
0
Helped
10724326
Points
622696

13015 octal is 1011000001101 binary.

Ad

1 Related Answer

Anonymous

  • 7 Answers
  • Posted on Mar 25, 2009

SOURCE: java code for adding octal, hexadecimal subtracting binary,

Hello desireejane,


One method is to do the following

  1. Convert the octal, hexadecimal or binary to decimal.
  2. Add or Subtract the decimal normally
  3. Convert the result back to octal, hexadecimal or binary.

  • Convert the octal to decimal:

public static long octalToDecimal(String octal) throws NumberFormatException {
// Initialize result to 0
long res = 0;

// Do not continue on an empty string
if (octal.isEmpty()) {
throw new NumberFormatException("Empty string is not an octal number");
}

// Consider each digit in the string
for (int i = 0; i < octal.length(); i++) {
// Get the nth char from the right (first = 0)
char n = octal.charAt(octal.length() - (i+1));

int f = (int) n - 48;
// Check if it's a valid bit
if (f < 0 || f > 7) {
// And if not, die horribly
throw new NumberFormatException("Not an octal number");
} else {
// Only add the value if it's a 1
res
+= f*Math.round(Math.pow(2.0, (3*i)));
}
}

return res;
}



Ad

Add Your Answer

×

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

0helpful
1answer

What is the meaning of octal

The octal numeral system, or oct for short, is the base-8 number system, and uses the digits 0 to 7. Octal numerals can be made from binary numerals by grouping consecutive binary digits into groups of three (starting from the right). For example, the binary representation for decimal 74 is 1001010, which can be grouped into (00)1 001 010 - so the octal representation is 112.
In the decimal system each decimal place is a power of ten. For example:
bcd885da3009955a0aaca3e7bb004380.png In the octal system each place is a power of eight. For example:
4219c7fffd93294e3d48bba6f898bd79.png By performing the calculation above in the familiar decimal system we see why 112 in octal is equal to 64+8+2 = 74 in decimal.

Hope this helps
1helpful
1answer

Casio fx-83GT-plus how to convert binary to hexadecimal

Sorry to be the carrier of bad news but the Casio FX-83 GT Plus does not have a baseN calculation mode. You cannot do any arithmetic in binary, octal or hexadecimal numeration.
1helpful
1answer

Casio fx-83GT plus how to convert binary to hex

Sorry to be the carrier of bad news but the Casio FX-83 GT Plus does not have a baseN calculation mode. You cannot do any arithmetic in binary, octal or hexadecimal numeration.
0helpful
2answers

How to convert octal numbers into binary numbers

Each octal digit represents three binary digits. Simply convert each octal digit to three binary digits and string them together.

0o = 000b
1o = 001b
2o = 010b
3o = 011b
4o = 100b
5o = 101b
6o = 110b
7o = 111b

As an example, to convert 351o to binary:
3o is 011b
5o is 101b
1o is 001b
so 351o is 011101001b
0helpful
1answer

How i convert octal to binary number?

Hey there,

You can use this conversion tool to figure this out:
http://www.translatorscafe.com/cafe/units-converter/numbers/calculator/octal-to-binary/

Hope this helps. If it did, feel free to rate.
0helpful
1answer

Java code for adding octal, hexadecimal subtracting binary,

Hello desireejane,


One method is to do the following

  1. Convert the octal, hexadecimal or binary to decimal.
  2. Add or Subtract the decimal normally
  3. Convert the result back to octal, hexadecimal or binary.

  • Convert the octal to decimal:

public static long octalToDecimal(String octal) throws NumberFormatException {
// Initialize result to 0
long res = 0;

// Do not continue on an empty string
if (octal.isEmpty()) {
throw new NumberFormatException("Empty string is not an octal number");
}

// Consider each digit in the string
for (int i = 0; i < octal.length(); i++) {
// Get the nth char from the right (first = 0)
char n = octal.charAt(octal.length() - (i+1));

int f = (int) n - 48;
// Check if it's a valid bit
if (f < 0 || f > 7) {
// And if not, die horribly
throw new NumberFormatException("Not an octal number");
} else {
// Only add the value if it's a 1
res
+= f*Math.round(Math.pow(2.0, (3*i)));
}
}

return res;
}



5helpful
2answers

How to convert to binary using casio fx-350MS?

Hello,
In the FX300Ms manual, the same for the FX350MS, there is no way to use base-n (binary, octal, hexadecimal) calculations.
Sorry.
1helpful
1answer

Binary conversion

Hello,
In the FX-300Ms manual, the same for the FX-82MS, there is no way to use base-n (binary, octal, hexadecimal) calculations.
Sorry.
0helpful
1answer

Programming in c

To convert numbers you can use the printf() function
printf("%d", x'FF') hex to decimal
printf("%o", x'FF') hex to octal

If you want to save the value in another variables use sprintf
e.g

a = x'FF';
b = sprintf("%d",a)


Not finding what you are looking for?

72 views

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

ADMIN Andrew
ADMIN Andrew

Level 3 Expert

73783 Answers

ADMIN Eric
ADMIN Eric

Level 3 Expert

42221 Answers

Brad Brown

Level 3 Expert

19190 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...