Message Boards Message Boards

0
|
3680 Views
|
4 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Why the Total[{}] operation on a list does not give me the total ?

Posted 9 years ago

I have the following operation on a list:

In[69]:= Total[{"{0.000019245008972987524}", 
  "{0.00001886580626702042}", "{0.000017455790451689365}", 
  "{0.00001963576060910879}", "{0.000019245008972987524}", 
  "{0.000017793092615557995}", "{0.000020882171194647923}", 
  "{0.00002045383034646352}", "{0.00001886580626702042}"}]

Out[69]= "{0.000017455790451689365}" + "{0.000017793092615557995}" + 
 2 "{0.00001886580626702042}" + 
 2 "{0.000019245008972987524}" + "{0.00001963576060910879}" + \
"{0.00002045383034646352}" + "{0.000020882171194647923}"

Why don't I get the result of the addition? Can anybody give me a hint?

POSTED BY: Moses Tenne
4 Replies
Posted 9 years ago

Bill, thank you very much. I got it now. Moses

POSTED BY: Moses Tenne
Posted 9 years ago
POSTED BY: Bill Simpson

Bill,

Was there supposed to be something here?

Moderation Team

POSTED BY: Moderation Team

Compare ...

In[15]:= Total[{"1", "2", "3"}]

Out[15]= "1" + "2" + "3"

In[16]:= Total[{1, 2, 3}]

Out[16]= 6

In[17]:= Total[ToExpression[{"1", "2", "3"}]]

Out[16]= 6

POSTED BY: Mark Tuttle
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract