convert to long

Romanian translation: conversie la valoare long

10:01 Jul 9, 2015
English to Romanian translations [PRO]
Computers: Software
English term or phrase: convert to long
How could I convert data from string to long?
Cristina Bolohan
Romania
Local time: 09:12
Romanian translation:conversie la valoare long
Explanation:
Avand ca data de intrare un sir de caractere , de exemplu ASCII, adica pe 2 octeti, se vrea conversia acestui sir de caractere ASCII la echivalentul lor ca valoare intreaga, pe 4 bytes sau pe 8 bytes.

Se presupune ca sirul de caractere care se vrea trasnformat contine doar caracterele ASCII corespunzatoare cifrelor zecimale adica de la '0' la '9'. Eventual semnul '-' , pentru valori negative.

De exemplu daca avem string-ul "123" acesta se vrea convertit la 123.


Dar pentru un string precum "abc34de" se va lansa o exceptie / returna o eroare.

Functia de conversie va trebui de asemenea sa faca o verificare a domeniului de valori. De exmeplu pentru un string precum : "89564342342341231231322127777"
va da o exceptie, valoarea numerica neputand fi reprezentata pe 4 sau pe 8 octeti (bytes).

--------------------------------------------------
Note added at 3 hrs (2015-07-09 13:43:36 GMT)
--------------------------------------------------

http://www.cplusplus.com/reference/cstdlib/atol/

--------------------------------------------------
Note added at 3 hrs (2015-07-09 13:44:50 GMT)
--------------------------------------------------

http://gsp.com/cgi-bin/man.cgi?section=3&topic=atol

--------------------------------------------------
Note added at 3 hrs (2015-07-09 13:45:06 GMT)
--------------------------------------------------

http://stackoverflow.com/questions/7370887/convert-an-ascii-...

--------------------------------------------------
Note added at 3 hrs (2015-07-09 13:45:28 GMT)
--------------------------------------------------

http://www.asciitable.com/

--------------------------------------------------
Note added at 3 hrs (2015-07-09 13:46:20 GMT)
--------------------------------------------------

https://msdn.microsoft.com/en-us/library/aa272023(v=vs.60).a...

--------------------------------------------------
Note added at 3 hrs (2015-07-09 13:48:22 GMT)
--------------------------------------------------

https://leetcode.com/problems/string-to-integer-atoi/

--------------------------------------------------
Note added at 3 hrs (2015-07-09 13:49:00 GMT)
--------------------------------------------------

https://leetcode.com/discuss/questions/oj/string-to-integer-...
Selected response from:

Vasile Airinei
Romania
Local time: 09:12
Grading comment
4 KudoZ points were awarded for this answer



Summary of answers provided
5 +2conversie la valoare long
Vasile Airinei


Discussion entries: 2





  

Answers


1 hr   confidence: Answerer confidence 5/5 peer agreement (net): +2
conversie la valoare long


Explanation:
Avand ca data de intrare un sir de caractere , de exemplu ASCII, adica pe 2 octeti, se vrea conversia acestui sir de caractere ASCII la echivalentul lor ca valoare intreaga, pe 4 bytes sau pe 8 bytes.

Se presupune ca sirul de caractere care se vrea trasnformat contine doar caracterele ASCII corespunzatoare cifrelor zecimale adica de la '0' la '9'. Eventual semnul '-' , pentru valori negative.

De exemplu daca avem string-ul "123" acesta se vrea convertit la 123.


Dar pentru un string precum "abc34de" se va lansa o exceptie / returna o eroare.

Functia de conversie va trebui de asemenea sa faca o verificare a domeniului de valori. De exmeplu pentru un string precum : "89564342342341231231322127777"
va da o exceptie, valoarea numerica neputand fi reprezentata pe 4 sau pe 8 octeti (bytes).

--------------------------------------------------
Note added at 3 hrs (2015-07-09 13:43:36 GMT)
--------------------------------------------------

http://www.cplusplus.com/reference/cstdlib/atol/

--------------------------------------------------
Note added at 3 hrs (2015-07-09 13:44:50 GMT)
--------------------------------------------------

http://gsp.com/cgi-bin/man.cgi?section=3&topic=atol

--------------------------------------------------
Note added at 3 hrs (2015-07-09 13:45:06 GMT)
--------------------------------------------------

http://stackoverflow.com/questions/7370887/convert-an-ascii-...

--------------------------------------------------
Note added at 3 hrs (2015-07-09 13:45:28 GMT)
--------------------------------------------------

http://www.asciitable.com/

--------------------------------------------------
Note added at 3 hrs (2015-07-09 13:46:20 GMT)
--------------------------------------------------

https://msdn.microsoft.com/en-us/library/aa272023(v=vs.60).a...

--------------------------------------------------
Note added at 3 hrs (2015-07-09 13:48:22 GMT)
--------------------------------------------------

https://leetcode.com/problems/string-to-integer-atoi/

--------------------------------------------------
Note added at 3 hrs (2015-07-09 13:49:00 GMT)
--------------------------------------------------

https://leetcode.com/discuss/questions/oj/string-to-integer-...

Vasile Airinei
Romania
Local time: 09:12
Specializes in field
Native speaker of: Native in RomanianRomanian
PRO pts in category: 29

Peer comments on this answer (and responses from the answerer)
agree  meirs: Makes sense
2 hrs
  -> multumesc!

agree  Iosif JUHASZ
19 hrs
  -> multumesc!
Login to enter a peer comment (or grade)



Login or register (free and only takes a few minutes) to participate in this question.

You will also have access to many other tools and opportunities designed for those who have language-related jobs (or are passionate about them). Participation is free and the site has a strict confidentiality policy.

KudoZ™ translation help

The KudoZ network provides a framework for translators and others to assist each other with translations or explanations of terms and short phrases.


See also:
Term search
  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search