View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
07277Bug reportsExpression Managerpublic2013-02-13 22:11
Reportercamills Assigned ToDenisChenu  
PriorityurgentSeveritypartial_block 
Status closedResolutionfixed 
Product Version2.00+ 
Summary07277: log(xx) seems to return an incorrect value
Description

using the log function returns incorrect values

TagsNo tags attached.
Attached Files
logsurvey.lss (11,851 bytes)
Bug heat8
Complete LimeSurvey version number (& build)130129
I will donate to the project if issue is resolvedNo
Browserchrome
Database type & versionSQL
Server OS (if known)LINUX
Webserver software & version (if known)Apache 2.2.23
PHP Version5.2.17

Users monitoring this issue

TMSWhite

Activities

Mazi

Mazi

2013-02-07 13:49

updater   ~23987

Here is some additional feedback. Seems like one can reproduce the problem by comparing the LS log() results with Excel's log() function:
"I have now checked everything and the bizarre result seems to be that LS gives log(67) as 4.2 whereas excel and other internet sources say it is 1.8!"

DenisChenu

DenisChenu

2013-02-07 14:10

developer   ~23988

Seems using ln and not log ...

DenisChenu

DenisChenu

2013-02-07 14:27

developer   ~23989

Not really a bug: it's default behaviour for php log AND for javascript log.

And:
"If not specified, the assumed base of the logarithm is either 10 or e, depending on context." ( http://en.wiktionary.org/wiki/log).

Question :
Don't change log(x), but put optionnal setting ?

  • Add ln + lg

Atually, you can do
{log(VALUE)/log(10)}

DenisChenu

DenisChenu

2013-02-07 16:09

developer   ~23990

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=11576

DenisChenu

DenisChenu

2013-02-07 17:02

developer   ~23991

Actually:

  • use {log(VALUE)/log(10)}
    Next update:
    {log(VALUE,10)}
DenisChenu

DenisChenu

2013-02-09 17:45

developer   ~24019

Fix committed to 2.1 branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=11610

DenisChenu

DenisChenu

2013-02-09 17:46

developer   ~24020

Documentaion updated too.
http://docs.limesurvey.org/Expression+Manager#Access_to_Functions

The logarithm of number to base, if given, or the natural logarithm.

c_schmitz

c_schmitz

2013-02-13 22:11

administrator   ~24061

New build 130213 released.

Related Changesets

LimeSurvey: master e6626643

2013-02-07 15:06:28

DenisChenu

Details Diff
Fixed issue 07277: log(xx) seems to return an incorrect value
Dev: add optionnal setting to log for base.
Affected Issues
07277
mod - application/helpers/expressions/em_core_helper.php Diff File
mod - scripts/expressions/em_javascript.js Diff File

LimeSurvey: 2.1 35913f4b

2013-02-09 16:41:54

DenisChenu

Details Diff
Fixed issue 07277: log(xx) seems to return an incorrect value
Dev: add optionnal setting to log for base.
Affected Issues
07277
mod - application/helpers/expressions/em_core_helper.php Diff File
mod - scripts/expressions/em_javascript.js Diff File

Issue History

Date Modified Username Field Change
2013-02-07 13:16 camills New Issue
2013-02-07 13:16 camills File Added: logsurvey.lss
2013-02-07 13:47 Mazi Assigned To => DenisChenu
2013-02-07 13:47 Mazi Status new => assigned
2013-02-07 13:49 Mazi Note Added: 23987
2013-02-07 14:10 DenisChenu Note Added: 23988
2013-02-07 14:14 Mazi Issue Monitored: TMSWhite
2013-02-07 14:27 DenisChenu Note Added: 23989
2013-02-07 16:09 DenisChenu Changeset attached => LimeSurvey master e6626643
2013-02-07 16:09 DenisChenu Note Added: 23990
2013-02-07 16:09 DenisChenu Resolution open => fixed
2013-02-07 17:02 DenisChenu Note Added: 23991
2013-02-09 17:45 DenisChenu Changeset attached => LimeSurvey 2.1 35913f4b
2013-02-09 17:45 DenisChenu Note Added: 24019
2013-02-09 17:46 DenisChenu Note Added: 24020
2013-02-09 17:46 DenisChenu Status assigned => resolved
2013-02-09 17:46 DenisChenu Fixed in Version => 2.10
2013-02-13 22:11 c_schmitz Note Added: 24061
2013-02-13 22:11 c_schmitz Status resolved => closed
2021-08-08 01:25 guest Bug heat 6 => 8