Linked Questions

4 votes
1 answer
6k views

Change number from real to integer [duplicate]

Possible Duplicate: Is this the most efficient way to round approximate integers to integers while leaving other Reals untouched? Please consider the following: ...
John's user avatar
  • 4,311
0 votes
0 answers
710 views

Remove decimal point from N function [duplicate]

For aesthetic reasons I want to remove the decimal point when I use the function N. For example when put in N[30] I get out <...
Turbotanten's user avatar
2 votes
1 answer
71 views

If function's argument is close to an integer how to choose the function definition for the integer argument? [duplicate]

I have the following function which is expressed through the numerical integration ...
Igor Kotelnikov's user avatar
36 votes
4 answers
5k views

Looking for "Longest Common Substring" solution

I'm looking for robust code to solve the "Longest Common Substring" problem: Find the longest string (or strings) that is a substring (or are substrings) of two or more strings. I can just code it ...
Reb.Cabin's user avatar
  • 8,651
12 votes
4 answers
5k views

Test if number represents an integer

I can't figure out how to test if a number is an integer. I have found IntegerQ, but this function only checks if the type of the input is an integer, not whether ...
mistercake's user avatar
10 votes
5 answers
1k views

Getting AbsoluteTiming to display in hours, minutes, and seconds

I'm doing some extended length calculations and was wondering how I could get AbsoluteTiming to display in hours, minutes, and seconds. I googled and found nothing, ...
Elem-Teach-w-Bach-n-Math-Ed's user avatar
6 votes
2 answers
3k views

Converting numbers to integers

I've read the available documentation but I still haven't found an NumberForm -> Integer function yet. No result in this site's search, either. Does it exist? ...
CHM's user avatar
  • 3,385
5 votes
1 answer
3k views

Axis label shifted in 3D plot

Does anybody know why the axis label is shifted in this plot? Probably because of the different lengths of the labels of the ticks? How can I have the axis label in the middle of the axis? The code ...
Thomas's user avatar
  • 339
5 votes
2 answers
610 views

Why is an integer not considered as a real?

Please consider the following: zeros={0.,0}; data={1, 0., 0}; DeleteCases[data, #]&/@zeros Head/@zeros (*{Real, Integer}*) (*{{1, 0}, {1, 0.}}*) For my ...
John's user avatar
  • 4,311
2 votes
2 answers
1k views

Remove leading zero and trailing decimal from display of number

I would like to remove the leading zero and trailing decimal from the display of numbers in plots. For example, to get the correlation values to fit inside the cells of a correlation matrix, I can ...
Aaron Bramson's user avatar
3 votes
2 answers
169 views

Writing a function for creating tick marks on plots

I have written the following function for creating tickmarks on the x and y axis. However, I don't understand that why it is not performing well at -0.1 and -0.6. ...
Hosein Rahnama's user avatar
1 vote
1 answer
227 views

How do I to remove a factor of 1 [duplicate]

I evaluated Subscript[ε, 1, 2] = 0.5 Subscript[γ, 1, 2] 2 μ Subscript[ε, 1, 2] 1. μ Subscript[γ, 1, 2] How do I to remove ...
ABCDEMMM's user avatar
  • 1,816
2 votes
2 answers
111 views

How to select pairs of numbers in function requirements?

How can I get only those cases where the second column has only two decimal places or less? ...
LCarvalho's user avatar
  • 9,145
0 votes
1 answer
55 views

How to correct not precise values

I have the source file file = "test.txt" with these values: ...
Karel's user avatar
  • 3