Hi guys,
I am in a first year prorgamming course using Scheme, and I was just wondering.
Given a number, say, 351021,
how could I extract a select section of the number? For example, 351 or 102?
In strings, I understand that you can use the simple command ';substring';, so i was just wondering if there's something similar to that with numbers
Thanks!How to extract numbers in Scheme?
you could put it in a list and just use tail- recursion to remove the numbers you want e.g.
(define...
(lambda (..)
(...-help n '())))
and so onHow to extract numbers in Scheme?
I think your best bet is to use write-to-string and subseq. Something like this:
(defun subint (num)
(parse-integer (subseq (write-to-string num) 0 3)))
(subint 351021) should give you back:
351
3
One note, I'm doing this in LISP. Where did you find a Scheme class?! I'm a bit jealous.
Saturday, December 26, 2009
Is there a simple, layman's explanation of how Euler numbers pertain to string theory?
Are they used for statistical analysis of probabilities, or are they geometric/topographic in nature, or something else entirely?Is there a simple, layman's explanation of how Euler numbers pertain to string theory?
They are used in quantifiable analysis
They are used in quantifiable analysis
What do the numbers under the crown on a pint glass stand for?
crown mark certifies a legal english pintnba players
What are the numbers behind a fortune cookie fortune?
In some fortune cookies, behind the paper slip with your 'fortune', there's a list of random numbers. What purpose do the numbers serve?
I've always wondered...What are the numbers behind a fortune cookie fortune?
Lottery numbers - they are supposed to be your lucky numbers, and if you play them in the lottery, you will supposedly win.What are the numbers behind a fortune cookie fortune?
That's how much you owe them if you win the lottery.
they are ment to be your lucky numbers
The message inside may also include a list of lucky numbers (used by some as lottery numbers) and a Chinese phrase with translation. Despite conventional wisdom, they were actually invented in California.
they r ur ';lucky'; numbers for the day
I've always wondered...What are the numbers behind a fortune cookie fortune?
Lottery numbers - they are supposed to be your lucky numbers, and if you play them in the lottery, you will supposedly win.What are the numbers behind a fortune cookie fortune?
That's how much you owe them if you win the lottery.
they are ment to be your lucky numbers
The message inside may also include a list of lucky numbers (used by some as lottery numbers) and a Chinese phrase with translation. Despite conventional wisdom, they were actually invented in California.
they r ur ';lucky'; numbers for the day
Why are the numbers on a dart board arranged the way they are?
I have been wondering for a while why the numbers are arranged the way they are...there is no pattern that i can tell....does anybody know the history behind this?Why are the numbers on a dart board arranged the way they are?
The numbers are arranged to reduce the element of luck and encourage accuracy. Small numbers are on both sides of the larger numbers, etc.Why are the numbers on a dart board arranged the way they are?
it prevents drunk people from thinking its a clock
The numbers are arranged to reduce the element of luck and encourage accuracy. Small numbers are on both sides of the larger numbers, etc.Why are the numbers on a dart board arranged the way they are?
it prevents drunk people from thinking its a clock
Write down two numbers that have a difference of 42?
Surely this is gonna be really easy and ill kick myself when i know the answer but im unsure what the word difference means?Write down two numbers that have a difference of 42?
21 %26amp; 63.
There are two explanations.
A: 42 is the difference of 21 %26amp; 63. 63 - 42 = 21.
B: 42 also the average of 21 %26amp; 63. 21 + 63 = 84, then divide by 2 %26amp; it equals 42, a second time.
Math_Maestro.Write down two numbers that have a difference of 42?
1, 43
- - - -
1 and 43
42 is just the amount of numbers between them
1, 43
2 and 44
21 %26amp; 63.
There are two explanations.
A: 42 is the difference of 21 %26amp; 63. 63 - 42 = 21.
B: 42 also the average of 21 %26amp; 63. 21 + 63 = 84, then divide by 2 %26amp; it equals 42, a second time.
Math_Maestro.Write down two numbers that have a difference of 42?
1, 43
- - - -
1 and 43
42 is just the amount of numbers between them
1, 43
2 and 44
Is there a way I can save my cell phone numbers?
So that when I loss my cell phone, And believe me I will I can just download them to my phone. I hope somebody can help me.Is there a way I can save my cell phone numbers?
Yes. Search for a computer interface cable %26amp; software for your particular model of phone. Most companies make an interface kit which allows a PC to store and manipulate phone number data as text. But they aren't cheap. The lowest price I've every paid for one is about $75, and it might not work with the next model of phone you buy! My best advice is to create a manual database of all the numbers in your phone. If you do just one or two a day, it doesn't take very long, and it costs you nothing.Is there a way I can save my cell phone numbers?
I agree with the answer posted by ';mvsopen';. I found some software and a cable at Radio Shack that worked with by Kyocera phone. I'm not sure the investment was worth it but I wanted to be able to extract all the info without having to write it all down. The cost ';mvsopen'; mentioned is about right: I know I spent at least $60 US. Gsthering the info manually is a very good idea, depending on what other functionality the software might provide and whether you decide it's worth the expense.
Yes. Search for a computer interface cable %26amp; software for your particular model of phone. Most companies make an interface kit which allows a PC to store and manipulate phone number data as text. But they aren't cheap. The lowest price I've every paid for one is about $75, and it might not work with the next model of phone you buy! My best advice is to create a manual database of all the numbers in your phone. If you do just one or two a day, it doesn't take very long, and it costs you nothing.Is there a way I can save my cell phone numbers?
I agree with the answer posted by ';mvsopen';. I found some software and a cable at Radio Shack that worked with by Kyocera phone. I'm not sure the investment was worth it but I wanted to be able to extract all the info without having to write it all down. The cost ';mvsopen'; mentioned is about right: I know I spent at least $60 US. Gsthering the info manually is a very good idea, depending on what other functionality the software might provide and whether you decide it's worth the expense.
Subscribe to:
Posts (Atom)