Error saying Error in sprintf x 2151028214 invalid format x use format f e g or a for numeric objects

0 votes

I'm trying to convert dec to hex using sprintf and i'm facing an error:

>  sprintf("%x",2109440182)
[1] "7dbb80b6"
>  sprintf("%x",2151028214)
Error in sprintf("%x", 2151028214) :
  invalid format '%x'; use format %f, %e, %g or %a for numeric objects
Nov 12, 2018 in Data Analytics by Ali
• 11,360 points
1,820 views

1 answer to this question.

0 votes

gcc : format ‘%x’ expects an argument of type ‘unsigned int’, but argument 2 has type ‘long int’.

The number is larger that an unsigned int. Max range in my system is 2147483648,

Try it in the following way:

printf("%x\n", 2147483647);

answered Nov 12, 2018 by Maverick
• 10,840 points

Related Questions In Data Analytics

0 votes
1 answer
0 votes
1 answer

Error: package or namespace load failed for ‘arulesViz’ in R

I installed package KernSmooth and it seemed ...READ MORE

answered Sep 4, 2020 in Data Analytics by Chandrakant
• 140 points
1,263 views
0 votes
2 answers

How to use group by for multiple columns in dplyr, using string vector input in R?

data = data.frame(   zzz11def = sample(LETTERS[1:3], 100, replace=TRUE),   zbc123qws1 ...READ MORE

answered Aug 6, 2019 in Data Analytics by anonymous
14,090 views
0 votes
1 answer

Error saying "Error in rnorm() : argument "n" is missing, with no default" in R

Hey @ali, rnorm() function requires an argument, ...READ MORE

answered Oct 30, 2018 in Data Analytics by Maverick
• 10,840 points
3,332 views
0 votes
1 answer

": cannot open the connection" Error in R

There can be two reasons for this ...READ MORE

answered Oct 31, 2018 in Data Analytics by Kalgi
• 52,350 points
5,069 views
+2 votes
1 answer

“subscript out of bounds” Error in r programming

This error is likely to occur when ...READ MORE

answered Oct 31, 2018 in Data Analytics by Kalgi
• 52,350 points
9,563 views
+1 vote
1 answer

What does “replacement has” Error mean?

This error occurs when one tries to ...READ MORE

answered Oct 31, 2018 in Data Analytics by Kalgi
• 52,350 points
689 views
0 votes
1 answer

Errors saying "Error: unexpected '}' in "}"

This is a syntax error: Enclose your if ...READ MORE

answered Nov 8, 2018 in Data Analytics by Maverick
• 10,840 points
3,121 views
0 votes
1 answer

Error saying "Error in df$item : object of type 'closure' is not subsettable" when trying to use arules package

Try replacing ID <- c("A123","A123","A123","A123","B456","B456","B456") item <- c("bread", "butter", ...READ MORE

answered Nov 15, 2018 in Data Analytics by Maverick
• 10,840 points
1,765 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP