octal Questions

3

Solved

I've got a problem when converting an octal number to a string. p = 01212 k = str(p) print k The result is 650 but I need 01212. How can I do this? Thanks in advance.
Sienkiewicz asked 11/5, 2015 at 5:34

5

Solved

I have the following error while running this code below: Code: <?php $a = array(00001, 00008, 00009, 00012); print_r($a); ?> Error: Parse error: Invalid numeric literal. Why this ...
Taegu asked 22/11, 2016 at 7:22

3

I try to install packages (pdbDEMO actually and all the dependencies) and I am encountering an issue, that I cannot solve and I haven't found any solution about it. I use the R command : >inst...
Selfpossessed asked 6/9, 2013 at 8:9

6

Solved

Why are Octal numeric literals not allowed in JavaScript strict mode? What is the harm? "use strict"; var x = 010; //Uncaught SyntaxError: Octal literals are not allowed in strict mode. <...
Expiratory asked 18/12, 2015 at 14:55

3

Solved

Still new to Git(Kraken). Had a logic board go bad on me, and had to restore a repo from a backup, reinstall software, and get back up and running on a temporary machine till I can get the original...
Divvy asked 20/11, 2018 at 18:11

3

Solved

I've always wondered why leading zeroes (0) are used to represent octal numbers, instead of — for example — 0o. The use of 0o would be just as helpful, but would not cause as many probl...
Electoral asked 14/7, 2012 at 11:1

4

Solved

I had this little homework assignment and I needed to convert decimal to octal and then octal to decimal. I did the first part and could not figure out the second to save my life. The first part we...
Jelks asked 17/2, 2016 at 7:40

4

Java provides ways for writing numeric literals in the bases 2, 8, 10 and 16. I am wondering why base 8 is included, e.g. int x = 0123;? I am thinking that there might be something akin to the fa...
Menu asked 28/10, 2019 at 7:36

9

Solved

I am trying to write following code.but it gives me error kindly help me. int six=06; int seven=07; int abc=018; int nine=011; System.out.println("Octal 011 ="+nine); System.out.println("oct...
Illinois asked 8/5, 2013 at 6:9

10

Solved

Try executing the following in JavaScript: parseInt('01'); //equals 1 parseInt('02'); //equals 2 parseInt('03'); //equals 3 parseInt('04'); //equals 4 parseInt('05'); //equals 5 parseInt('06'); //...
Alar asked 11/5, 2009 at 22:14

1

Solved

My teacher says that for the assignment we are not allowed to manually print the 0x before the hex number, we have to make the system do it. Currently my code looks like this: cout << "Hex...
Dosser asked 22/9, 2019 at 23:30

3

Solved

Why is n in const int n = -0123; an octal literal? I thought that all octal literals had to start with a 0, and this one doesn't since it starts with a negative. It's a small point I know but ...
Bloodstained asked 16/3, 2018 at 15:56

0

I have some problem while reading a file with numbers, when the number is '09' or '08'. The string I read loks like 0:09.21 this. It's a time value. I want to calculate the ms of this value....
Springe asked 30/1, 2018 at 16:57

3

Solved

I have Two Functions. IsOcta and isHex. Can not seem to make isHex work properly. Issue in isHex() is that it can not omit 'x' notation of the original string x23. Original hex srting can also be...
Siderite asked 28/10, 2012 at 20:54

1

Solved

I would like to use mkdir in python. It has a parameter mode, whose default value is '0o777'. I know file mode 0777 in Linux. However I don't know what o between 0 and 777 is. What is it?
Raby asked 4/10, 2017 at 10:12

2

Solved

I am trying to write a small Python 2.x API to support fetching a job by jobNumber, where jobNumber is provided as an integer. Sometimes the users provide ajobNumber as an integer literal beginning...
Delfeena asked 16/7, 2012 at 22:22

5

Why is it that following results in 34? It doesn't seem to have anything to do with octal numbers. intval(042);
Armillia asked 15/6, 2011 at 4:13

1

Solved

I was working with code that parses crontab. https://mcmap.net/q/801839/-php-function-that-receive-a-cron-string-and-return-the-next-run-timestamp I found it works great, however I found that if ...
Hanger asked 29/12, 2016 at 16:17

4

My code is like $perm = "0777"; //this is fetched from the database chmod("myFolder/", $perm); but the value of $perm is not in octal, how can I change the data type of the var...
Theomachy asked 23/2, 2015 at 10:54

3

I have the following logic in my bash script: #!/bin/bash local_time=$(date +%H%M) if (( ( local_time > 1430 && local_time < 2230 ) || ( local_time > 0300 && local_time &...
Lecce asked 28/3, 2011 at 7:20

6

Solved

I tried making a C program to convert a user entered decimal number to octal. I wrote the C code with my own logic without any research of how other users try to do it. It works fine for the number...
Florettaflorette asked 2/11, 2012 at 4:11

9

I have just begun teaching myself C out of K.N King's C Programming: A Modern Approach (2ndEdn). I'm enjoying it, but am hoping to post the odd question here for advice if appropriate because unf...
Egbert asked 19/3, 2011 at 11:18

5

Solved

I'm working with a database that has a bunch of serial numbers that are prefixed with leading 0's. So a serial number can look like 00032432 or 56332432. Problem is with PHP I don't understand ...
Contort asked 22/3, 2010 at 20:47

3

Solved

See https://issues.scala-lang.org/browse/SI-5205 and https://github.com/scala/scala-dist/pull/20 Octal escape value leading 0 has been deprecated from scala and I don't see an idiomatic alternati...
Bunting asked 16/5, 2013 at 14:30

7

Solved

I am having trouble in Tcl using numbers with leading zeros. I am parsing some numbers that can have leading zeros, such as "0012", which should be interpreted as the integer "twelve". $ tclsh % s...
Puttier asked 21/1, 2010 at 16:25

© 2022 - 2025 — McMap. All rights reserved.