lucene-solr scale function reutuns minTarget when having same scores for all the items in the result set

I want to normalize the score for a particular query relative to the result set for the query and filter out only more relevant results based on a threshold.

I am using the scale function to normalize scores of result as below and using the normalized score to filter the results which exceeds a threshold using the range function

 "{!func}scale(query({!edismax v=$q}), 0, 100)" 

When result contains exactly one item or multiple items with (scaleInfo.maxVal-scaleInfo.minVal==0) same score, scale function returns minTarget value as the normalized score. As the value is less than the threshold, a valid result may not appear in the final output.

In scale function scale calculated as zero for the scenario (scaleInfo.maxVal-scaleInfo.minVal==0) ? 0 ) which i guess the issue

final float scale = (scaleInfo.maxVal-scaleInfo.minVal==0) ? 0 : (max-min)/(scaleInfo.maxVal-scaleInfo.minVal);

Is the above usage of scale (normalization) is correct ? Is my observation regrinding the scale function is correct ? How should i handle the scenario ? or is it a bug in the scale function ?